package com.atguigu.jxc.dao;

import com.atguigu.jxc.entity.ReturnList;
import com.atguigu.jxc.entity.ReturnListGoods;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: dongdong lau
 * @CreateTime: 2021/7/24 10:20
 * @Description: 退货接口
 */
@Mapper
public interface ReturnDao {

    /**
     * 向退货表中插入数据
     * @param returnList
     * @return
     */
    Integer saveReturnList(ReturnList returnList);

    /**
     * 向退货商品中添加数据
     * @param returnListGoods
     * @return
     */
    Integer saveReturnListGoods(ReturnListGoods returnListGoods);

    /**
     * 加库存
     * @param goodsId
     * @param goodsNum
     * @return
     */
    Integer reduceGoods(@Param("goodsId") Integer goodsId, @Param("goodsNum") Integer goodsNum);

    /**
     * 退货单列表展示
     * @param returnNumber
     * @param supplierId
     * @param state
     * @param sTime
     * @param eTime
     * @return
     */
    List<ReturnList> list(@Param("returnNumber") String returnNumber,
                          @Param("supplierId") Integer supplierId,
                          @Param("state") Integer state,
                          @Param("sTime") String sTime,
                          @Param("eTime") String eTime);

    /**
     * 查询退货单商品信息
     * @param returnListId
     * @return
     */
    List<ReturnListGoods> getReturnListGoodsById(@Param("returnListId") Integer returnListId);

    /**
     * 根据returnListId删除进货单数据
     * @param returnListId
     * @return
     */
    Integer deleteReturnListById(@Param("returnListId") Integer returnListId);
}
